package logic

import (
	"context"
	"month/videosvr/internal/service"

	"month/videosvr/internal/svc"
	"month/videosvr/video"

	"github.com/zeromicro/go-zero/core/logx"
)

type UpdateVideoLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewUpdateVideoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateVideoLogic {
	return &UpdateVideoLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// UpdateVideo todo 笔记权限修改
func (l *UpdateVideoLogic) UpdateVideo(in *video.UpdateVideoReq) (*video.UpdateVideoRes, error) {
	// todo: add your logic here and delete this line
	err := service.UpdateVideo(int(in.Id), int(in.Status))
	if err != nil {
		return &video.UpdateVideoRes{}, err
	}
	return &video.UpdateVideoRes{}, nil
}
